home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 23 / q23.d81 / t.sfx demo < prev    next >
Text File  |  2022-08-28  |  3KB  |  82 lines

  1.                             S F X    P L A Y E R
  2.  
  3.                              by Reiner Richter
  4.  
  5.  
  6.      Reiner Richter, a super programmer from Downunder, has been making a
  7. name for himself on LOADSTAR 64 lately.  On LS #120 (the gala 10th
  8. Anniversary Issue) we published his SFX GENERATOR, a utility that allows you
  9. to make incredible sound effects and save them in a file with a player, then
  10. add the player to your BASIC or ML programs for easy sound effects.  The
  11. best thing is that he made his player work in both the C-64 and the C-128
  12. modes!
  13.  
  14.      Check out AULD LANG SYNE for the sounds.  Would you believe that it
  15. took about 10 minutes for me to add sounds to that program?  I had to do no
  16. POKEing to the SID chip.  I simply Bloaded the player and sound effects
  17. file, initialized the interrupt routine, then played the sounds with one
  18. SYS.
  19.  
  20.      I've placed some player/sfx files on this disk that have twenty wild
  21. sounds.  They're assembled at several places between $1300 and $4000 so you
  22. shouldn't have any problem finding one that doesn't interfere with other ML
  23. routines you use.  If you want to use sound effects with CONTROL80-C (as I
  24. did in AULD LANG SYNE) you should use the one assembled at $2300, which is
  25. right at the end of CONTROL80-C's code.
  26.  
  27.      Here, in a nutshell, is how to use "sfx player xxxx" in your program:
  28.  
  29.  (1) BLOAD the player.
  30.  
  31.      10 dv=peek(186):ifdv<8thendv=8
  32.  
  33.      20 bload"sfx player 1300",u(dv),p4864
  34.  
  35.  (2) Enable the player.
  36.  
  37.      30 ad=4864:sysad:sysad+12
  38.  
  39.  (3) Play one of the sounds:
  40.  
  41.      200 sysad+6,x     [where x is any number between 0 and 255]
  42.  
  43.  (4) When quitting your program, you should disable the player.
  44.  
  45.      9000 sysad+15
  46.  
  47.      That's all there is to it.
  48.  
  49.      I've placed a little demo on this disk which will allow you to hear the
  50. sounds in "sfx player 1300".  It's mainly the five lines above with a
  51. minimum of embellishments.   At least it returns to LOADSTAR 128 sooner or
  52. later.
  53.  
  54.      The second parameter in the play command can be any number between 0
  55. and 255, but you only have as many sounds as were saved with the SFX
  56. GENERATOR.  With "sfx player 1300" you can use any number between 0 and 19.
  57. With "als sfx" it's any number between 0 and 5.
  58.  
  59. NOTE: Since the player sees each sound as numbers between 0 and 255, and
  60. that's what every memory location in your computer has in it anyway, if you
  61. sysad+6,38 and the player you loaded has only 20 sounds, you'll simply get a
  62. random sound.  In the demo, once you get past 20 you're hearing random
  63. sounds, some of which might sound pretty good!
  64.  
  65.      One word of warning: when you are programming with interrupt-driven
  66. routines (such as this player) it's a good idea to disable the interrupt as
  67. soon as you break out of the program to edit the code.  Who knows where in
  68. the interrupt cycle it is?  I had the program lock up a couple of times when
  69. I re-ran it.  Just enter SYSAD+15 right after hitting STOP/RESTORE and all
  70. will be well.
  71.  
  72.      I cannot recommend Reiner's SFX GENERATOR too highly.  I plan to use it
  73. in many of my future C-128 programs.   If you don't subscribe to LOADSTAR 64
  74. you can get issue #120 by calling 1-800-594-3370 and asking for it as a back
  75. issue.  I'm hoping that more programmers take a hint from Reiner and make
  76. their ML routines work in both the 64 and the 128 modes.
  77.  
  78. FT
  79.  
  80.                    \\\\\ R - Run    RETURN - Menu \\\\\
  81.  
  82.